package net.wisos.opn.service;

import java.util.Date;

import net.wisos.opn.dao.OrderDao;
import net.wisos.opn.entity.Order;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Component;


@Component
public class OrderManager {
	@Autowired
	private OrderDao orderDao;

	public Order getOrder(Long orderId) {
		return orderDao.findOne(orderId);
	}

	public Page<Order> findOrders(Date startDate, Date endDate,
			Pageable pageable) {
		return orderDao.findByOrderDateBetween(startDate, endDate, pageable);
	}
}
